#!/usr/bin/env bash
#### 6-1关联产品新增出入库数量字段等解释第一步
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/improve/firstInitAddAllProduct -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","page":1,"pageSize":8,"saasMark":1,"xbbCode":123456,"businessType":201,"attr":"array_4","afterAttr":"text_3","fieldAttr":"required","operate":2}'
#### 6-2合同退货数量
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/improve/fixContractInStockNum -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","page":1,"pageSize":8,"saasMark":1,"xbbCode":123456,"businessType":1701,"attr":"array_1","afterAttr":"num_3","fieldAttr":"required","operate":2}'
#### 6-3生产单出库数量
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/improve/fixProductionOutStockNum -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","page":1,"pageSize":8,"saasMark":1,"xbbCode":123456,"businessType":1701,"attr":"array_1","afterAttr":"num_3","fieldAttr":"required","operate":2}'
#### 6-4刷合同出货数量
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/improve/fixContractOutStockNum -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","page":1,"pageSize":8,"saasMark":1,"xbbCode":123456,"businessType":1701,"attr":"array_1","afterAttr":"num_3","fieldAttr":"required","operate":2}'
#### 6-5刷退货退款入货数量
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/improve/fixRefundInStockNum -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","page":1,"pageSize":8,"saasMark":1,"xbbCode":123456,"businessType":1701,"attr":"array_1","afterAttr":"num_3","fieldAttr":"required","operate":2}'
#### 6-6刷采购退货单出货数量
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/improve/fixReturnPurchaseOutStockNum -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","page":1,"pageSize":8,"saasMark":1,"xbbCode":123456,"businessType":1701,"attr":"array_1","afterAttr":"num_3","fieldAttr":"required","operate":2}'
#### 6-7刷数据采购合同入库数量
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/improve/fixPurchaseInStockNum -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","page":1,"pageSize":8,"saasMark":1,"xbbCode":123456,"businessType":1701,"attr":"array_1","afterAttr":"num_3","fieldAttr":"required","operate":2}'
#### 6-8刷采购合同退货数量
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/improve/fixPurchaseOutStockNum -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","page":1,"pageSize":8,"saasMark":1,"xbbCode":123456,"businessType":1701,"attr":"array_1","afterAttr":"num_3","fieldAttr":"required","operate":2}'
#### 6-9刷工单出货数量
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/improve/fixWorkOrderOutStockNum -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","page":1,"pageSize":8,"saasMark":1,"xbbCode":123456,"businessType":1701,"attr":"array_1","afterAttr":"num_3","fieldAttr":"required","operate":2}'
#### 6-10刷调拨单入库数量
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/improve/fixTransferInStockNum -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","page":1,"pageSize":8,"saasMark":1,"xbbCode":123456,"businessType":1701,"attr":"array_1","afterAttr":"num_3","fieldAttr":"required","operate":2}'
#### 6-11合同状态
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/improve/fiXContractShipStatus -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","page":1,"pageSize":8,"saasMark":1,"xbbCode":123456,"businessType":1701,"attr":"array_1","afterAttr":"num_3","fieldAttr":"required","operate":2}'
#### 6-12采购状态
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/improve/fixPurchaseReceieveStatus -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","page":1,"pageSize":8,"saasMark":1,"xbbCode":123456,"businessType":1701,"attr":"array_1","afterAttr":"num_3","fieldAttr":"required","operate":2}'
#### 6-13退货状态
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/improve/fixRefundStatus -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","page":1,"pageSize":8,"saasMark":1,"xbbCode":123456,"businessType":1701,"attr":"array_1","afterAttr":"num_3","fieldAttr":"required","operate":2}'
#### 6-14采购退货状态
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/improve/fixReturnedPurchaseStatus -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","page":1,"pageSize":8,"saasMark":1,"xbbCode":123456,"businessType":1701,"attr":"array_1","afterAttr":"num_3","fieldAttr":"required","operate":2}'
#### 6-15刷调拨状态
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/improve/fixTransferStatus -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","page":1,"pageSize":8,"saasMark":1,"xbbCode":123456,"businessType":1701,"attr":"array_1","afterAttr":"num_3","fieldAttr":"required","operate":2}'
#### 6-16刷盘点单状态
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/improve/fixInventoryStatus -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","page":1,"pageSize":8,"saasMark":1,"xbbCode":123456,"businessType":1701,"attr":"array_1","afterAttr":"num_3","fieldAttr":"required","operate":2}'
#### 6-17刷数据销售退货入库单价
curl http://pt2jobs.xbongbong.com.cn/pro/v1/script/field/improve/fixRefundInstockPrice -X POST -H 'Content-type: application/json' -d '{"corpid":"1","corpidList":[],"userId":"1","platform":"web","frontDev":"1","page":1,"pageSize":8,"saasMark":1,"xbbCode":123456,"businessType":1701,"attr":"array_1","afterAttr":"num_3","fieldAttr":"required","operate":2}'
#### 6-18调拨单数据es同步
curl http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/formDataInit -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid":"1","userId":"1","platform":"web","saasMark":1,"businessType":1601,"byCorpid":0}'
#### 6-19盘点单数据es同步
curl http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/formDataInit -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid":"1","userId":"1","platform":"web","saasMark":1,"businessType":1701,"byCorpid":0}'
#### 生成新的默认解释
curl http://pt2jobs.xbongbong.com.cn/pro/v1/field/initExplain -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid":"1","userId":"1","platform":"web"}'
#### 盘点单未出入库移除空批次
update tb_saas_inventory_product set `data`= JSON_SET(`data`,"$.text_5", "", "$.num_8",0, "$.num_9",0,"$.num_40",0),batch = "", produce_date = 0, guarantee_period = 0 where inventory_id in (SELECT id FROM tb_saas_inventory WHERE `data`->"$.text_68" = "1" and del = 0) and batch = "空" and del = 0;
#### 调拨单未出入库移除空批次
update tb_saas_transfer_product set `data`= JSON_SET(`data`,"$.text_5", "", "$.num_8",0, "$.num_9",0,"$.num_40",0),batch = "", produce_date = 0, guarantee_period = 0 where transfer_id in (SELECT id FROM tb_saas_transfer WHERE `data`->"$.text_68" = "1" and del = 0) and batch = "空" and del = 0;
#### 6-20 产品批次库存索引数据删除saasDataInit
GET test3_idx_saas_product/product_stock_info/_delete_by_query
{
  "query": { "match_all": {} }
}
#### 6-21产品和批次库存数据es同步重建
#### 测试公司：
curl http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/formDataInitByCorpidListAndBusinessTypeList -X POST -H 'Content-type: application/json' -d '{"corpid":"1","userId":"1","corpidList":["ding45b220254ed2e97335c2f4657eb6378f","dingfebc45745cb7863135c2f4657eb6378f","ding66041eb1c6df73f535c2f4657eb6378f","dinga93c84f4d89688bf35c2f4657eb6378f","ding51d0a413630fcca735c2f4657eb6378f"],"platform":"web","frontDev":"1","xbbCode":"123456","businessTypeList":[2401,2404]}'
#### 所有公司：
curl http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/saasDataInit -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid":"1","userId":"1","platform":"web","saasMark":1,"businessType":2404,"byCorpid":0,"fromInit":1}'
curl http://pt2jobs.xbongbong.com.cn/pro/v1/esInit/formDataInit -X POST -H 'Content-type: application/json' -d '{"frontDev":"1","xbbCode":123456,"corpid":"1","userId":"1","platform":"web","saasMark":1,"businessType":2401,"byCorpid":0,"fromInit":1}'
###### 结束##########